package com.Ajava1704.for并发包下的类.ForCycliyer;

import com.Ajava1704.for并发包下的类.ForCountDownLatch.ForCountRunable;

import java.util.concurrent.CyclicBarrier;

/**
 * 作者: LCG
 * 日期: 2020/2/11 10:49
 * 描述:
 */
public class ForTestCyclibier {

    public static void main(String[] args) {

        CyclicBarrier cyclicBarrier=new CyclicBarrier(3);

        Thread thread=new Thread(new ForCycliRunable(cyclicBarrier,2),"A");
        thread.start();

        Thread thread2=new Thread(new ForCycliRunable(cyclicBarrier,5),"B");
        thread2.start();

        Thread thread3=new Thread(new ForCycliRunable(cyclicBarrier,3),"C");
        thread3.start();

        //================================
        Thread thread4=new Thread(new ForCycliRunable(cyclicBarrier,2),"E");
        thread4.start();

        Thread thread5=new Thread(new ForCycliRunable(cyclicBarrier,5),"F");
        thread5.start();

        Thread thread6=new Thread(new ForCycliRunable(cyclicBarrier,3),"G");
        thread6.start();

        System.out.println("=====================");

    }
}
